package cn.gs.dmw.controller;

import cn.gs.dmw.pojo.UserInfo;
import cn.gs.dmw.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;

    @GetMapping(value = "/userInfo")
    public String findUserById(Integer id, Model model) {
        UserInfo user = userInfoService.findUserById(id);
        model.addAttribute("user", user);
        return "userInfo";
    }
}
